#include <cstdio>
#include <cstring>
using namespace std;

int main()
{
	int i, len, num, sum;
    char ss[31];
    int s[31];
	char ans[100];
    memset(s, 0, sizeof s);

	while (scanf("%s", ss) != EOF) {
		len = strlen(ss);
		for (i = 0; i < len; i++)
			s[i] = ss[i] - '0';
		
		num = 0;
		memset(ans, 0, sizeof ans);

		do {
			/* sum of each digit */
			sum = 0;

			/* % 2 */
			ans[num++] = s[len - 1] % 2 + '0';

			/* / 2 */
			for (i = 0; i < len - 1; i++) {
				s[i+1] += (s[i] - ((s[i] >> 1) << 1)) * 10;
				s[i] >>= 1;
				sum += s[i];
			}
			s[i] >>= 1;
			sum += s[i];
		} while (sum != 0);

		while (num--)
			putchar(ans[num]);
		putchar('\n');
	}
	return 0;
}